﻿(function ($) { 
$.fn.HelpTextFn = function (options) {// 
var defaults = { 
helpText: "default help text", 
bgcolor: "red", 
ftcolor: "yellow", 
width: "200px", 
tempLeft: "15", 
tempTop: "15" 
} 
var options = $.extend(defaults, options); 
var linkDivId = $(this).attr("id"); 
$(this).mousemove(function (e) { 
if ($("#linkDiv" + linkDivId)) { 
$("#linkDiv" + linkDivId).remove(); 
} 
var xx = e.originalEvent.x || e.originalEvent.layerX || 0; 
var yy = e.originalEvent.y || e.originalEvent.layerY || 0; 
var left = xx + parseInt(options.tempLeft); 
var top = yy + parseInt(options.tempTop); 
$("#" + linkDivId).after("<div id='linkDiv" + linkDivId + "' style='background-color:" + options.bgcolor + ";color:" + options.ftcolor + ";width:" + options.width + ";display:none;top:" + top + "px;left:" + left + "px;position:absolute;float:left'>" + options.helpText + "</div>"); 
$("#linkDiv" + linkDivId).show(); 
}); 
$(this).mouseleave(function () { 
$("#linkDiv" + linkDivId).remove(); 
}); 
}; 
})(jQuery); 